package org.scboy.dbms.valid.common;

import java.util.ArrayList;
import java.util.List;

import org.scboy.dbms.annotation.ValidType;
import org.scboy.dbms.entity.ParamConfig;
import org.scboy.dbms.valid.Valid;
import org.scboy.utils.entitys.coobi.Model;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;

@ValidType("必填")
public class EmptyValid implements Valid {

	@Override
	public List<ParamConfig> config() {
		return new ArrayList<ParamConfig>();
	}

	@Override
	public boolean valid(Object value,Model data, Model config) {
		if(StrUtil.isEmpty(Convert.toStr(value))){
			return false;
		}
		return true;
	}

	@Override
	public String toString(Model config) {
		return "必填";
	}
	

}
